<template>
	<view class="device_detail">
		<nav-bar :cateList="cateList" :curTab="curTab" @tabIndex="tabIndex"></nav-bar>

		<!-- 智水站 -->
		<water-station v-show="curTab == 0" />

		<hall v-show="curTab == 1" />
		<menu-bottom></menu-bottom>
	</view>
</template>

<script>
import navBar from '@/components/xq-nav-bar/index.vue'
import waterStation from './waterStation.vue'
import hall from './hall.vue'
import * as util from '@/common/util'

export default {
	components: {
		navBar,
		waterStation,
		hall
	},

	data() {
		return {
			curTab: 0,
			cateList: [
				{
					name: '智水站',
					url: '/mv/all'
				},
				// {
				// 	name: '大厅',
				// 	url: '/mv/first'
				// },
				// {
				// 	name: '办公B区',
				// 	url: '/mv/exclusive/rcmd'
				// },
				// {
				// 	name: '经理办公室',
				// 	url: '/mv/all?area=内地'
				// },
				// {
				// 	name: '总裁办公室',
				// 	url: '/mv/all?area=内地'
				// }
			]
		}
	},
  mounted(){
    util.requestGet('/client/device/waterstationInfo/list', {
      pageNo: 1,
      pageSize: 10,
    }).then(({ data }) => {
    })
    util.requestGet('/client/system/companyOfficial/list', {
      companyId: '',
    }).then(({ data }) => {

      this.cateList = _.concat(this.cateList, _.map(data.records, (n, i) => {
           return {
             name: n.officialName,
             ...n,
           }
         }),
      )
      console.log(`this.cateList`, this.cateList)
    })
  },
  methods: {
		tabIndex(index) {
			this.curTab = index
		}
	}
}
</script>

<style lang="scss">
.device_detail {
	background-color: rgb(247, 247, 247);
}
</style>
